﻿<%@ Page Title="Simple Embeddable Wiki Engine" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Page.aspx.cs" Inherits="Altairis.Sewen.WebApp.Sewen.Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainCPH" runat="server">
    <asp:FormView ID="PageFormView" runat="server" DataSourceID="PageObjectDataSource" RenderOuterTable="false">
        <EmptyDataTemplate>
            <h1 class="title">Page not found</h1>
            <div class="head">
                <asp:HyperLink runat="server" NavigateUrl="<%$ RouteUrl: RouteName=SewenWikiPageNew %>" Text="new page" />
                |
                <asp:HyperLink runat="server" NavigateUrl="<%$ RouteUrl: RouteName=SewenWikiSearch %>" Text="search" />
            </div>
            <div class="body">
                <p>Specified page was not found.</p>
            </div>
        </EmptyDataTemplate>
        <ItemTemplate>
            <h1 class="title">
                <asp:Literal runat="server" Text='<%# Eval("Title") %>' />
            </h1>
            <div class="head">
                <asp:Literal runat="server" Text='<%# Eval("Version", "Version: {0:d} {0:T} | ") %>' />
                <asp:Literal runat="server" Text='<%# Eval("UserName", "User: {0} | ") %>' />
                <asp:Literal runat="server" Text='<%# Eval("IpAddress", "IP: {0} | ") %>' />
                <asp:HyperLink runat="server" NavigateUrl="<%$ RouteUrl: RouteName=SewenWikiPageHistory %>" Text="history" />
                |
                <asp:HyperLink runat="server" NavigateUrl="<%$ RouteUrl: RouteName=SewenWikiPageEdit %>" Text="edit page" />
                |
                <asp:HyperLink runat="server" NavigateUrl="<%$ RouteUrl: RouteName=SewenWikiPageNew %>" Text="new page" />
                |
                <asp:HyperLink runat="server" NavigateUrl="<%$ RouteUrl: RouteName=SewenWikiSearch %>" Text="search" />
            </div>
            <sewen:WikiMarkup runat="server" CssClass="body" Text='<%# Eval("Body") %>' />
        </ItemTemplate>
    </asp:FormView>
    <asp:ObjectDataSource ID="PageObjectDataSource" runat="server" TypeName="Altairis.Sewen.PageStoreManager" DataObjectTypeName="Altairis.Sewen.SewenPage" SelectMethod="LoadPage">
        <SelectParameters>
            <asp:RouteParameter Name="name" RouteKey="slug" Type="String" DefaultValue="home-page" />
            <asp:RouteParameter Name="versionString" RouteKey="version" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>
